﻿using AnyLink.Domain.Enums;
using Newtonsoft.Json;
using SqlSugar;

namespace AnyLink.Domain.Entities.System
{
    /// <summary>
    /// 字典数据表
    /// </summary>
    [SugarTable("sys_dict_data", TableDescription = "字典数据表", IsDisabledUpdateAll = true)]
    public class SysDictData : BaseAuditedEntity<long>
    {
        /// <summary>
        /// 字典编码
        /// </summary>
        [SugarColumn(ColumnName = "dict_code", IsPrimaryKey = true, ColumnDescription = "字典编码")]
        [JsonProperty(propertyName: "dictCode")]
        public override long Id { get; set; }

        /// <summary>
        /// 字典排序
        /// </summary>
        [SugarColumn(ColumnName = "dict_sort", ColumnDescription = "字典排序", IsNullable = true)]
        public int DictSort { get; set; }

        /// <summary>
        /// 字典标签
        /// </summary>
        [SugarColumn(ColumnName = "dict_label", ColumnDataType = "VARCHAR(100)", ColumnDescription = "字典标签", IsNullable = true)]
        public string DictLabel { get; set; }

        /// <summary>
        /// 字典键值
        /// </summary>
        [SugarColumn(ColumnName = "dict_value", ColumnDataType = "VARCHAR(100)", ColumnDescription = "字典键值", IsNullable = true)]
        public string DictValue { get; set; }

        /// <summary>
        /// 字典类型
        /// </summary>
        [SugarColumn(ColumnName = "dict_type", ColumnDataType = "VARCHAR(100)", ColumnDescription = "字典类型", IsNullable = true)]
        public string DictType { get; set; }

        /// <summary>
        /// 样式属性（其他样式扩展）
        /// </summary>
        [SugarColumn(ColumnName = "css_class", ColumnDataType = "VARCHAR(100)", ColumnDescription = "样式属性（其他样式扩展）", IsNullable = true)]
        public string CssClass { get; set; }

        /// <summary>
        /// 表格回显样式
        /// </summary>
        [SugarColumn(ColumnName = "list_class", ColumnDataType = "VARCHAR(100)", ColumnDescription = "表格回显样式", IsNullable = true)]
        public string ListClass { get; set; }

        /// <summary>
        /// 是否默认（Y是 N否）
        /// </summary>
        [SugarColumn(ColumnName = "is_default", ColumnDescription = "是否默认（Y是 N否）", IsNullable = true)]
        public string IsDefault { get; set; }

        /// <summary>
        /// 状态（0正常 1停用）
        /// </summary>
        [SugarColumn(ColumnName = "status", ColumnDescription = "状态（0正常 1停用）", IsNullable = true)]
        public StatusEnum Status { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnName = "remark", ColumnDataType = "VARCHAR(500)", ColumnDescription = "备注", IsNullable = true)]
        public string Remark { get; set; }
    }
}